<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let arr = [10, 200, 33, 24, 0, 15, 0, 66, 17, 98]
      let arrNew = []
      for (let i = 0; i < arr.length; i++) {
        if (arr[i] !== 0) {
          arrNew.push(arr[i])
        }
      }
      let max = arrNew[0]
      let sign = 0
      for (let i = 0; i < arrNew.length; i++) {
        if (arrNew[i] > max) {
          max = arrNew[i]
          sign = i
        }
      }
      document.write(`新数组中最大值为${max},下标为${sign}`)
    </script>
  </body>
</html>
